#pragma once
#include"HashTable.h"


namespace my
{
	template<class K,class Hash = HashFunc<K>>
	class unordered_set
	{
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename hash_bucket::HashTable<K,const K,SetKeyOfT, Hash>::Iterator iterator;
		typedef typename hash_bucket::HashTable<K,const K,SetKeyOfT, Hash>::ConstIterator const_iterator;
		const_iterator cbegin() const
		{
			return _ht.cbegin();
		}

		const_iterator cend() const
		{
			return _ht.cend();
		}

		iterator begin()
		{
			return _ht.begin();
		}

		iterator end()
		{
			return _ht.end();
		}


		pair<iterator,bool> insert(const K& key)
		{
			return _ht.insert(key);
		}

		iterator find(const K& key)
		{
			return _ht.find(key);
		}

		bool erase(const K& key)
		{
			return _ht.erase(key);
		}
	private:
		hash_bucket::HashTable<K, const K,SetKeyOfT, Hash>  _ht;
	};
}
